Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structured logging for node + WebAssembly bindings #1235

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

insipx
Copy link
Contributor

@insipx insipx commented Nov 8, 2024

This PR allows enabling structured logging for Node and WASM. Namely, enabling structured logging emits JSON logs. These logs may be filtered by additional K/V pairs added mostly during the sync process. This allows precise filtering of the sync process for chosen values.
K/V Pairs:

  • inbox_id
  • group_id
  • message sender
  • intent id
  • intent kind
  • sender_inbox_id

@rygine this adds some options to the Node/JS Sdk, client creation methods, would appreciate your review

@insipx insipx requested a review from a team as a code owner November 8, 2024 20:19
bindings_wasm/src/client.rs Outdated Show resolved Hide resolved
@@ -184,17 +185,17 @@ impl InboxOwner for Wallet {
async fn main() -> color_eyre::eyre::Result<()> {
color_eyre::install()?;
let cli = Cli::parse();
let crate_name = env!("CARGO_PKG_NAME");
let filter = EnvFilter::builder().parse(format!("{crate_name}=INFO,xmtp_mls=INFO"))?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the CLI to test the new filtering used

@insipx insipx requested a review from rygine November 8, 2024 20:21
tracing::info!(
inbox_id = self.client.inbox_id(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many of these K/Vs are the same, eventually can make them into a macro

@insipx insipx force-pushed the insipx/structured-logging-node branch from 84b0514 to e6cb4ca Compare November 8, 2024 20:34
@insipx insipx force-pushed the insipx/structured-logging-node branch 2 times, most recently from 13b3643 to 23fd444 Compare November 8, 2024 22:41
@insipx insipx enabled auto-merge (squash) November 8, 2024 22:42
@insipx insipx force-pushed the insipx/structured-logging-node branch from 23fd444 to eddaffe Compare November 8, 2024 22:58
@insipx insipx changed the title Allow enabling structured logging structured logging for node + WebAssembly bindings Nov 8, 2024
@insipx insipx force-pushed the insipx/structured-logging-node branch 2 times, most recently from 0a47a3d to 11d058e Compare November 8, 2024 23:15
@insipx insipx force-pushed the insipx/structured-logging-node branch 2 times, most recently from 3ca1085 to 689d78b Compare November 8, 2024 23:34
@insipx insipx force-pushed the insipx/structured-logging-node branch from 689d78b to 80b8878 Compare November 8, 2024 23:37
@insipx insipx merged commit 5e227e3 into main Nov 8, 2024
19 checks passed
@insipx insipx deleted the insipx/structured-logging-node branch November 8, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants